Skip to content

Implement auto-verification for plural-native workflows - #3921

Merged
michaeljguarino merged 3 commits into
masterfrom
verification-loops
Jul 28, 2026
Merged

Implement auto-verification for plural-native workflows#3921
michaeljguarino merged 3 commits into
masterfrom
verification-loops

Conversation

@michaeljguarino

@michaeljguarino michaeljguarino commented Jul 28, 2026

Copy link
Copy Markdown
Member
  • If we know a stack run is spawned by a workbench, auto-verify once it was successful
  • for services, leverage the new queued prompts to enqueue 15m in the future, when it's almost certainly reconciled.

Test Plan

Test environment: https://console.your-env.onplural.sh/

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have deployed the agent to a test environment and verified that it works as expected (required only when changing agent code).

Plural Flow: console

@michaeljguarino
michaeljguarino requested a review from a team July 28, 2026 03:34
@michaeljguarino michaeljguarino added the enhancement New feature or request label Jul 28, 2026
@soffi-ai

soffi-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Soffi AI Summary

This PR introduces an auto-verification system for plural-native AI workbench workflows, closing the feedback loop between AI-driven operations and their outcomes without requiring manual intervention.

Core motivation: When a workbench AI agent triggers a stack run or service deployment, there was no mechanism to automatically verify whether the operation succeeded. This PR adds a "queued prompt" concept — a deferred prompt enqueued for future execution — that allows the system to schedule a follow-up verification check once a stack run completes or a service has had time to reconcile.

Key changes:

  1. Queued Prompts schema & pipeline — A new QueuedPrompt Ecto schema (lib/console/schema/queued_prompts.ex) is introduced with a dequeableAt timestamp, enabling time-deferred prompt scheduling. A Broadway-based pipeline (lib/console/pipelines/ai/queued_prompt/) processes these prompts when they become eligible. A database migration adds the required fields.

  2. Stack run auto-verification — When a workbench spawns a stack run and it succeeds, the pubsub recursion handler (lib/console/deployments/pubsub/recurse.ex) now automatically triggers a verification prompt rather than requiring manual follow-up.

  3. Service deployment verification — The service inspection tool (lib/console/ai/tools/workbench/infrastructure/service_inspect.ex) and its prompt template now enqueue a delayed verification prompt (~15 minutes out) using queued prompts, giving services time to reconcile before the AI checks their status. The service prompt template is updated to inform the agent of this behavior.

  4. PR follow-up enqueueing — A new GraphQL mutation enqueueWorkbenchPrFollowup allows enqueueing a verification prompt tied to a PR URL, supporting post-merge verification workflows.

  5. GraphQL & OpenAPI surface — New mutations (createQueuedPrompt, enqueueWorkbenchPrFollowup) and types are added to the Absinthe GraphQL schema, OpenAPI spec, and the auto-generated Go client (go/client/), making queued prompts accessible from both the frontend and Go operator.

  6. Workbench mentions — A new Console.AI.Workbench.Mentions module handles @mention style references within workbench prompts, enabling richer prompt context.

  7. RBAC — Queued prompt operations are properly gated behind RBAC policies.

Commits

Commit Summary
9e1bf6c Introduces the QueuedPrompt Ecto schema with dequeableAt scheduling support, CRUD operations in the workbenches context, a Broadway-based producer/pipeline for dequeuing eligible prompts, database migration, RBAC policies, and GraphQL/OpenAPI surface for queued prompts.
8fa0528 Adds auto-generated Go client mutations (CreateQueuedPrompt, EnqueueWorkbenchPrFollowup) and the corresponding GraphQL fragment/types in go/client/, wiring the new queued prompt API into the Go operator client interface.
cad73f9 Implements auto-verification logic: stack runs spawned by a workbench now trigger an automatic verification prompt on success (via pubsub recursion); service deployments enqueue a delayed (~15m) queued prompt to verify reconciliation; adds the enqueueWorkbenchPrFollowup mutation for post-merge PR verification; adds a Mentions module for workbench prompt context; updates service inspection tool and prompt templates to reflect deferred verification behavior.

Deploy in Soffi


Updated: 2026-07-28 16:39 UTC

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Implements automatic verification for successful workbench-originated stack runs.

  • Records the stack run created when a merged stack pull request is polled.
  • Sends a verification prompt to the associated workbench after successful completion.
  • Adds the pull-request-to-stack-run schema relationship and migration.
  • Updates the bundled deployment agent to v0.6.54.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
lib/console/deployments/pubsub/recurse.ex Records merged pull requests' generated stack runs and invokes workbench verification on successful stack-queue runs.
lib/console/deployments/workbenches.ex Adds the successful-stack-run lookup and verification-message creation flow.
lib/console/schema/pull_request.ex Adds the stack-run association, query helper, and changeset field.
lib/console/schema/workbench_job.ex Adds a query for locating a workbench job through a pull request's stack run.
priv/repo/migrations/20260727224601_add_wb_verification_fields.exs Adds the nullable indexed stack_run_id foreign key to pull requests.
test/console/deployments/pubsub/recurse_test.exs Covers recording generated stack runs and creating verification activity after successful completion.

Reviews (2): Last reviewed commit: "Implement auto-verification for plural-n..." | Re-trigger Greptile

Comment thread lib/console/deployments/pubsub/recurse.ex
Comment thread lib/console/deployments/workbenches.ex
@michaeljguarino

Copy link
Copy Markdown
Member Author

@greptileai

@michaeljguarino
michaeljguarino force-pushed the verification-loops branch 4 times, most recently from 462e9c3 to 6cb4bec Compare July 28, 2026 15:44
@michaeljguarino

Copy link
Copy Markdown
Member Author

plural deploy this

@plural-copilot plural-copilot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* If we know a stack run is spawned by a workbench, auto-verify once it was successful
* figure out appropriate service equivalent.
@michaeljguarino

Copy link
Copy Markdown
Member Author

plural deploy this

@plural-copilot plural-copilot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaeljguarino

Copy link
Copy Markdown
Member Author

plural deploy this

@plural-copilot plural-copilot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaeljguarino
michaeljguarino merged commit eccd673 into master Jul 28, 2026
48 checks passed
@michaeljguarino
michaeljguarino deleted the verification-loops branch July 28, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants